package com.project.weather.controller;

import com.project.weather.common.AResultCode;
import com.project.weather.common.ResultMap;
import com.project.weather.pojo.CityBean;
import com.project.weather.service.CityService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping( value="/base/")
public class CommonController {

    private static final Logger log = LoggerFactory.getLogger(CityController.class);

    @Autowired
    private CityService cityService;

    @ApiOperation(value="查询所有城市数据接口")
    @RequestMapping(name="查询所有城市数据接口",value="listAllCity.json",method = RequestMethod.POST)
    public ResultMap<AResultCode, List<Map>> listAllCity(@ApiParam(value = "对象数据", required = true) @RequestBody(required = false) CityBean bean){
        return cityService.listAllCity(bean);
    }
}
